package bairui.international.model.domain.jpa;

import com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue;

/**
 *
 * (产品订单)TB_ProductOrder
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_ProductOrder#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@javax.persistence.Inheritance(strategy = javax.persistence.InheritanceType.JOINED)
@javax.persistence.Entity(name="t_productOrder")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("产品订单")
@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单")
public class TB_ProductOrder
 extends TBSuper_BaseIDAndTimeAndOrderValue
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 状态 */
		public bairui.international.model.status.State_ProductOrder getState();
		/** 编号 */
		public String getNumber();
		/** 价格 */
		public Double getPrice();
		/** 积分 */
		public Double getScore();
		/** 类型 */
		public bairui.international.model.type.Type_ProductOrder getType();
		/** 中心指派标志 */
		public Boolean getAssignFlag();
		/** 用户 */
		public bairui.international.model.domain.jpa.TB_User getUser();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_ProductOrder properties(MustProperties properties) {
		this.setState(properties.getState());
		this.setNumber(properties.getNumber());
		this.setPrice(properties.getPrice());
		this.setScore(properties.getScore());
		this.setType(properties.getType());
		this.setAssignFlag(properties.getAssignFlag());
		this.setUser(properties.getUser());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_ProductOrder(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 付款方式 */
		public bairui.international.model.type.Type_ProductOrderPay getPayWay();
		/** 提交时间 */
		public java.util.Date getSubmitDate();
		/** 抵扣的积分 */
		public Double getUsedScore();
		/** 实际付款 */
		public Double getPay();
		/** 区域记录 */
		public String getAreaRecord();
		/** 用户信息 */
		public bairui.international.model.domain.jpa.TB_UserInfo getUserInfo();
		/** 图片 */
		public String getImgUrl();
		/** 收货信息 */
		public bairui.international.model.domain.jpa.TB_GoodsInfo getGoodsInfo();
		/** 汇款截图 */
		public String getRemitImgUrl();
		/** 电子券 */
		public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket();
		/** 备注 */
		public String getComment();
		/** 分公司 */
		public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany();
		/** 区域 */
		public bairui.international.model.domain.jpa.TB_Town getArea();
		/** 分配者 */
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getAssignor();
		/** 配送者 */
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getSender();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_ProductOrder properties(OptionalSingleProperties properties) {
		this.setPayWay(properties.getPayWay());
		this.setSubmitDate(properties.getSubmitDate());
		this.setUsedScore(properties.getUsedScore());
		this.setPay(properties.getPay());
		this.setAreaRecord(properties.getAreaRecord());
		this.setUserInfo(properties.getUserInfo());
		this.setImgUrl(properties.getImgUrl());
		this.setGoodsInfo(properties.getGoodsInfo());
		this.setRemitImgUrl(properties.getRemitImgUrl());
		this.setElectronicTicket(properties.getElectronicTicket());
		this.setComment(properties.getComment());
		this.setBranchCompany(properties.getBranchCompany());
		this.setArea(properties.getArea());
		this.setAssignor(properties.getAssignor());
		this.setSender(properties.getSender());
		return this;
	}
	
	
	
	public TB_ProductOrder(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 状态 */
		public bairui.international.model.status.State_ProductOrder getState();
		/** 编号 */
		public String getNumber();
		/** 价格 */
		public Double getPrice();
		/** 积分 */
		public Double getScore();
		/** 类型 */
		public bairui.international.model.type.Type_ProductOrder getType();
		/** 中心指派标志 */
		public Boolean getAssignFlag();
		/** 用户 */
		public bairui.international.model.domain.jpa.TB_User getUser();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_ProductOrder properties(CurrentMustProperties properties) {
		this.setState(properties.getState());
		this.setNumber(properties.getNumber());
		this.setPrice(properties.getPrice());
		this.setScore(properties.getScore());
		this.setType(properties.getType());
		this.setAssignFlag(properties.getAssignFlag());
		this.setUser(properties.getUser());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 付款方式 */
		public bairui.international.model.type.Type_ProductOrderPay getPayWay();
		/** 提交时间 */
		public java.util.Date getSubmitDate();
		/** 抵扣的积分 */
		public Double getUsedScore();
		/** 实际付款 */
		public Double getPay();
		/** 区域记录 */
		public String getAreaRecord();
		/** 用户信息 */
		public bairui.international.model.domain.jpa.TB_UserInfo getUserInfo();
		/** 图片 */
		public String getImgUrl();
		/** 收货信息 */
		public bairui.international.model.domain.jpa.TB_GoodsInfo getGoodsInfo();
		/** 汇款截图 */
		public String getRemitImgUrl();
		/** 电子券 */
		public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket();
		/** 备注 */
		public String getComment();
		/** 分公司 */
		public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany();
		/** 区域 */
		public bairui.international.model.domain.jpa.TB_Town getArea();
		/** 分配者 */
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getAssignor();
		/** 配送者 */
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getSender();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_ProductOrder properties(CurrentOptionalSingleProperties properties) {
		this.setPayWay(properties.getPayWay());
		this.setSubmitDate(properties.getSubmitDate());
		this.setUsedScore(properties.getUsedScore());
		this.setPay(properties.getPay());
		this.setAreaRecord(properties.getAreaRecord());
		this.setUserInfo(properties.getUserInfo());
		this.setImgUrl(properties.getImgUrl());
		this.setGoodsInfo(properties.getGoodsInfo());
		this.setRemitImgUrl(properties.getRemitImgUrl());
		this.setElectronicTicket(properties.getElectronicTicket());
		this.setComment(properties.getComment());
		this.setBranchCompany(properties.getBranchCompany());
		this.setArea(properties.getArea());
		this.setAssignor(properties.getAssignor());
		this.setSender(properties.getSender());
		return this;
	}
	
	public TB_ProductOrder(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_ProductOrder(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean
	) {
		update(bean);
	}
	
	public TB_ProductOrder update(com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_ProductOrder.this);
			if(isOverride_getOrderValue){
				TB_ProductOrder.this.setOrderValue(orderValue);
			}
	
			bairui.international.model.status.State_ProductOrder state = getState(TB_ProductOrder.this);
			if(isOverride_getState){
				TB_ProductOrder.this.setState(state);
			}
	
			bairui.international.model.type.Type_ProductOrderPay payWay = getPayWay(TB_ProductOrder.this);
			if(isOverride_getPayWay){
				TB_ProductOrder.this.setPayWay(payWay);
			}
	
			String number = getNumber(TB_ProductOrder.this);
			if(isOverride_getNumber){
				TB_ProductOrder.this.setNumber(number);
			}
	
			java.util.Date submitDate = getSubmitDate(TB_ProductOrder.this);
			if(isOverride_getSubmitDate){
				TB_ProductOrder.this.setSubmitDate(submitDate);
			}
	
			Double price = getPrice(TB_ProductOrder.this);
			if(isOverride_getPrice){
				TB_ProductOrder.this.setPrice(price);
			}
	
			Double usedScore = getUsedScore(TB_ProductOrder.this);
			if(isOverride_getUsedScore){
				TB_ProductOrder.this.setUsedScore(usedScore);
			}
	
			Double pay = getPay(TB_ProductOrder.this);
			if(isOverride_getPay){
				TB_ProductOrder.this.setPay(pay);
			}
	
			String areaRecord = getAreaRecord(TB_ProductOrder.this);
			if(isOverride_getAreaRecord){
				TB_ProductOrder.this.setAreaRecord(areaRecord);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderStateRecord> productOrderStateRecords = getProductOrderStateRecords(TB_ProductOrder.this);
			if(isOverride_getProductOrderStateRecords){
				TB_ProductOrder.this.setProductOrderStateRecords(productOrderStateRecords);
			}
	
			bairui.international.model.domain.jpa.TB_UserInfo userInfo = getUserInfo(TB_ProductOrder.this);
			if(isOverride_getUserInfo){
				TB_ProductOrder.this.setUserInfo(userInfo);
			}
	
			String imgUrl = getImgUrl(TB_ProductOrder.this);
			if(isOverride_getImgUrl){
				TB_ProductOrder.this.setImgUrl(imgUrl);
			}
	
			bairui.international.model.domain.jpa.TB_GoodsInfo goodsInfo = getGoodsInfo(TB_ProductOrder.this);
			if(isOverride_getGoodsInfo){
				TB_ProductOrder.this.setGoodsInfo(goodsInfo);
			}
	
			String remitImgUrl = getRemitImgUrl(TB_ProductOrder.this);
			if(isOverride_getRemitImgUrl){
				TB_ProductOrder.this.setRemitImgUrl(remitImgUrl);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord> branchCompanyStaffRoyaltyRecords = getBranchCompanyStaffRoyaltyRecords(TB_ProductOrder.this);
			if(isOverride_getBranchCompanyStaffRoyaltyRecords){
				TB_ProductOrder.this.setBranchCompanyStaffRoyaltyRecords(branchCompanyStaffRoyaltyRecords);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_UserGradeRecord> userGradeRecords = getUserGradeRecords(TB_ProductOrder.this);
			if(isOverride_getUserGradeRecords){
				TB_ProductOrder.this.setUserGradeRecords(userGradeRecords);
			}
	
			Double score = getScore(TB_ProductOrder.this);
			if(isOverride_getScore){
				TB_ProductOrder.this.setScore(score);
			}
	
			bairui.international.model.type.Type_ProductOrder type = getType(TB_ProductOrder.this);
			if(isOverride_getType){
				TB_ProductOrder.this.setType(type);
			}
	
			bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket = getElectronicTicket(TB_ProductOrder.this);
			if(isOverride_getElectronicTicket){
				TB_ProductOrder.this.setElectronicTicket(electronicTicket);
			}
	
			String comment = getComment(TB_ProductOrder.this);
			if(isOverride_getComment){
				TB_ProductOrder.this.setComment(comment);
			}
	
			bairui.international.model.domain.jpa.TB_BranchCompany branchCompany = getBranchCompany(TB_ProductOrder.this);
			if(isOverride_getBranchCompany){
				TB_ProductOrder.this.setBranchCompany(branchCompany);
			}
	
			bairui.international.model.domain.jpa.TB_Town area = getArea(TB_ProductOrder.this);
			if(isOverride_getArea){
				TB_ProductOrder.this.setArea(area);
			}
	
			Boolean assignFlag = getAssignFlag(TB_ProductOrder.this);
			if(isOverride_getAssignFlag){
				TB_ProductOrder.this.setAssignFlag(assignFlag);
			}
	
			bairui.international.model.domain.jpa.TB_BranchCompanyStaff assignor = getAssignor(TB_ProductOrder.this);
			if(isOverride_getAssignor){
				TB_ProductOrder.this.setAssignor(assignor);
			}
	
			bairui.international.model.domain.jpa.TB_BranchCompanyStaff sender = getSender(TB_ProductOrder.this);
			if(isOverride_getSender){
				TB_ProductOrder.this.setSender(sender);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems = getProductOrderItems(TB_ProductOrder.this);
			if(isOverride_getProductOrderItems){
				TB_ProductOrder.this.setProductOrderItems(productOrderItems);
			}
	
			bairui.international.model.domain.jpa.TB_User user = getUser(TB_ProductOrder.this);
			if(isOverride_getUser){
				TB_ProductOrder.this.setUser(user);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords = getBranchCompanyMoneyRecords(TB_ProductOrder.this);
			if(isOverride_getBranchCompanyMoneyRecords){
				TB_ProductOrder.this.setBranchCompanyMoneyRecords(branchCompanyMoneyRecords);
			}
		}
	
		public TB_ProductOrder up(){
			return TB_ProductOrder.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_ProductOrder it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 状态 */
		private boolean isOverride_getState = true;
		public bairui.international.model.status.State_ProductOrder getState(TB_ProductOrder it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 付款方式 */
		private boolean isOverride_getPayWay = true;
		public bairui.international.model.type.Type_ProductOrderPay getPayWay(TB_ProductOrder it) throws Exception { 
			isOverride_getPayWay = false; 
			return null;
		}
		/** 编号 */
		private boolean isOverride_getNumber = true;
		public String getNumber(TB_ProductOrder it) throws Exception { 
			isOverride_getNumber = false; 
			return null;
		}
		/** 提交时间 */
		private boolean isOverride_getSubmitDate = true;
		public java.util.Date getSubmitDate(TB_ProductOrder it) throws Exception { 
			isOverride_getSubmitDate = false; 
			return null;
		}
		/** 价格 */
		private boolean isOverride_getPrice = true;
		public Double getPrice(TB_ProductOrder it) throws Exception { 
			isOverride_getPrice = false; 
			return null;
		}
		/** 抵扣的积分 */
		private boolean isOverride_getUsedScore = true;
		public Double getUsedScore(TB_ProductOrder it) throws Exception { 
			isOverride_getUsedScore = false; 
			return null;
		}
		/** 实际付款 */
		private boolean isOverride_getPay = true;
		public Double getPay(TB_ProductOrder it) throws Exception { 
			isOverride_getPay = false; 
			return null;
		}
		/** 区域记录 */
		private boolean isOverride_getAreaRecord = true;
		public String getAreaRecord(TB_ProductOrder it) throws Exception { 
			isOverride_getAreaRecord = false; 
			return null;
		}
		/** 产品订单状态记录 */
		private boolean isOverride_getProductOrderStateRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderStateRecord> getProductOrderStateRecords(TB_ProductOrder it) throws Exception { 
			isOverride_getProductOrderStateRecords = false; 
			return null;
		}
		/** 用户信息 */
		private boolean isOverride_getUserInfo = true;
		public bairui.international.model.domain.jpa.TB_UserInfo getUserInfo(TB_ProductOrder it) throws Exception { 
			isOverride_getUserInfo = false; 
			return null;
		}
		/** 图片 */
		private boolean isOverride_getImgUrl = true;
		public String getImgUrl(TB_ProductOrder it) throws Exception { 
			isOverride_getImgUrl = false; 
			return null;
		}
		/** 收货信息 */
		private boolean isOverride_getGoodsInfo = true;
		public bairui.international.model.domain.jpa.TB_GoodsInfo getGoodsInfo(TB_ProductOrder it) throws Exception { 
			isOverride_getGoodsInfo = false; 
			return null;
		}
		/** 汇款截图 */
		private boolean isOverride_getRemitImgUrl = true;
		public String getRemitImgUrl(TB_ProductOrder it) throws Exception { 
			isOverride_getRemitImgUrl = false; 
			return null;
		}
		/** 分公司员工提成记录 */
		private boolean isOverride_getBranchCompanyStaffRoyaltyRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord> getBranchCompanyStaffRoyaltyRecords(TB_ProductOrder it) throws Exception { 
			isOverride_getBranchCompanyStaffRoyaltyRecords = false; 
			return null;
		}
		/** 用户积分记录 */
		private boolean isOverride_getUserGradeRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_UserGradeRecord> getUserGradeRecords(TB_ProductOrder it) throws Exception { 
			isOverride_getUserGradeRecords = false; 
			return null;
		}
		/** 积分 */
		private boolean isOverride_getScore = true;
		public Double getScore(TB_ProductOrder it) throws Exception { 
			isOverride_getScore = false; 
			return null;
		}
		/** 类型 */
		private boolean isOverride_getType = true;
		public bairui.international.model.type.Type_ProductOrder getType(TB_ProductOrder it) throws Exception { 
			isOverride_getType = false; 
			return null;
		}
		/** 电子券 */
		private boolean isOverride_getElectronicTicket = true;
		public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket(TB_ProductOrder it) throws Exception { 
			isOverride_getElectronicTicket = false; 
			return null;
		}
		/** 备注 */
		private boolean isOverride_getComment = true;
		public String getComment(TB_ProductOrder it) throws Exception { 
			isOverride_getComment = false; 
			return null;
		}
		/** 分公司 */
		private boolean isOverride_getBranchCompany = true;
		public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany(TB_ProductOrder it) throws Exception { 
			isOverride_getBranchCompany = false; 
			return null;
		}
		/** 区域 */
		private boolean isOverride_getArea = true;
		public bairui.international.model.domain.jpa.TB_Town getArea(TB_ProductOrder it) throws Exception { 
			isOverride_getArea = false; 
			return null;
		}
		/** 中心指派标志 */
		private boolean isOverride_getAssignFlag = true;
		public Boolean getAssignFlag(TB_ProductOrder it) throws Exception { 
			isOverride_getAssignFlag = false; 
			return null;
		}
		/** 分配者 */
		private boolean isOverride_getAssignor = true;
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getAssignor(TB_ProductOrder it) throws Exception { 
			isOverride_getAssignor = false; 
			return null;
		}
		/** 配送者 */
		private boolean isOverride_getSender = true;
		public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getSender(TB_ProductOrder it) throws Exception { 
			isOverride_getSender = false; 
			return null;
		}
		/** 产品订单项 */
		private boolean isOverride_getProductOrderItems = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> getProductOrderItems(TB_ProductOrder it) throws Exception { 
			isOverride_getProductOrderItems = false; 
			return null;
		}
		/** 用户 */
		private boolean isOverride_getUser = true;
		public bairui.international.model.domain.jpa.TB_User getUser(TB_ProductOrder it) throws Exception { 
			isOverride_getUser = false; 
			return null;
		}
		/** 分公司金额记录 */
		private boolean isOverride_getBranchCompanyMoneyRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> getBranchCompanyMoneyRecords(TB_ProductOrder it) throws Exception { 
			isOverride_getBranchCompanyMoneyRecords = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_ProductOrder() {
	}
	
	public TB_ProductOrder(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_ProductOrder(
		@lombok.NonNull TB_ProductOrder bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setState(bean.getState());
		this.setPayWay(bean.getPayWay());
		this.setNumber(bean.getNumber());
		this.setSubmitDate(bean.getSubmitDate());
		this.setPrice(bean.getPrice());
		this.setUsedScore(bean.getUsedScore());
		this.setPay(bean.getPay());
		this.setAreaRecord(bean.getAreaRecord());
		this.setProductOrderStateRecords(bean.getProductOrderStateRecords());
		this.setUserInfo(bean.getUserInfo());
		this.setImgUrl(bean.getImgUrl());
		this.setGoodsInfo(bean.getGoodsInfo());
		this.setRemitImgUrl(bean.getRemitImgUrl());
		this.setBranchCompanyStaffRoyaltyRecords(bean.getBranchCompanyStaffRoyaltyRecords());
		this.setUserGradeRecords(bean.getUserGradeRecords());
		this.setScore(bean.getScore());
		this.setType(bean.getType());
		this.setElectronicTicket(bean.getElectronicTicket());
		this.setComment(bean.getComment());
		this.setBranchCompany(bean.getBranchCompany());
		this.setArea(bean.getArea());
		this.setAssignFlag(bean.getAssignFlag());
		this.setAssignor(bean.getAssignor());
		this.setSender(bean.getSender());
		this.setProductOrderItems(bean.getProductOrderItems());
		this.setUser(bean.getUser());
		this.setLastModifier(bean.getLastModifier());
		this.setBranchCompanyMoneyRecords(bean.getBranchCompanyMoneyRecords());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private bairui.international.model.status.State_ProductOrder state;

	@com.lianjing.sh.model.common.annotation.Comment("付款方式")
	@com.lianjing.sh.processing.info.annotation.InfoComment("付款方式")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="payWay")
	private bairui.international.model.type.Type_ProductOrderPay payWay;

	@com.lianjing.sh.model.common.annotation.Comment("编号")
	@com.lianjing.sh.processing.info.annotation.InfoComment("编号")
	@javax.persistence.Column(name="number", unique=true, nullable=false, length=32)
	private String number;

	@com.lianjing.sh.model.common.annotation.Comment("提交时间")
	@com.lianjing.sh.processing.info.annotation.InfoComment("提交时间")
	@javax.persistence.Column(name="submitDate")
	private java.util.Date submitDate;

	@com.lianjing.sh.model.common.annotation.Comment("价格")
	@com.lianjing.sh.processing.info.annotation.InfoComment("价格")
	@javax.persistence.Column(name="price", nullable=false)
	private Double price;

	@com.lianjing.sh.model.common.annotation.Comment("抵扣的积分")
	@com.lianjing.sh.processing.info.annotation.InfoComment("抵扣的积分")
	@javax.persistence.Column(name="usedScore")
	private Double usedScore;

	@com.lianjing.sh.model.common.annotation.Comment("实际付款")
	@com.lianjing.sh.processing.info.annotation.InfoComment("实际付款")
	@javax.persistence.Column(name="pay")
	private Double pay;

	@com.lianjing.sh.model.common.annotation.Comment("区域记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("区域记录")
	@javax.persistence.Column(name="areaRecord")
	private String areaRecord;

	@com.lianjing.sh.model.common.annotation.Comment("产品订单状态记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单状态记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="productOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderStateRecord> productOrderStateRecords;

	@com.lianjing.sh.model.common.annotation.Comment("用户信息")
	@com.lianjing.sh.processing.info.annotation.InfoComment("用户信息")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToOne(cascade={javax.persistence.CascadeType.ALL}, mappedBy="productOrder")
	private bairui.international.model.domain.jpa.TB_UserInfo userInfo;

	@com.lianjing.sh.model.common.annotation.Comment("图片")
	@com.lianjing.sh.processing.info.annotation.InfoComment("图片")
	@javax.persistence.Column(name="imgUrl", length=500)
	private String imgUrl;

	@com.lianjing.sh.model.common.annotation.Comment("收货信息")
	@com.lianjing.sh.processing.info.annotation.InfoComment("收货信息")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToOne(cascade={javax.persistence.CascadeType.ALL}, mappedBy="productOrder")
	private bairui.international.model.domain.jpa.TB_GoodsInfo goodsInfo;

	@com.lianjing.sh.model.common.annotation.Comment("汇款截图")
	@com.lianjing.sh.processing.info.annotation.InfoComment("汇款截图")
	@javax.persistence.Column(name="remitImgUrl", length=500)
	private String remitImgUrl;

	@com.lianjing.sh.model.common.annotation.Comment("分公司员工提成记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司员工提成记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="productOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord> branchCompanyStaffRoyaltyRecords;

	@com.lianjing.sh.model.common.annotation.Comment("用户积分记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("用户积分记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="productOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_UserGradeRecord> userGradeRecords;

	@com.lianjing.sh.model.common.annotation.Comment("积分")
	@com.lianjing.sh.processing.info.annotation.InfoComment("积分")
	@javax.persistence.Column(name="score", nullable=false)
	private Double score;

	@com.lianjing.sh.model.common.annotation.Comment("类型")
	@com.lianjing.sh.processing.info.annotation.InfoComment("类型")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="type", nullable=false)
	private bairui.international.model.type.Type_ProductOrder type;

	@com.lianjing.sh.model.common.annotation.Comment("电子券")
	@com.lianjing.sh.processing.info.annotation.InfoComment("电子券")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToOne(mappedBy="productOrder")
	private bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket;

	@com.lianjing.sh.model.common.annotation.Comment("备注")
	@com.lianjing.sh.processing.info.annotation.InfoComment("备注")
	@javax.persistence.Column(name="comment", length=255)
	private String comment;

	@com.lianjing.sh.model.common.annotation.Comment("分公司")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_BranchCompany branchCompany;

	@com.lianjing.sh.model.common.annotation.Comment("区域")
	@com.lianjing.sh.processing.info.annotation.InfoComment("区域")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Town area;

	@com.lianjing.sh.model.common.annotation.Comment("中心指派标志")
	@com.lianjing.sh.processing.info.annotation.InfoComment("中心指派标志")
	@javax.persistence.Column(name="assignFlag", nullable=false)
	private Boolean assignFlag;

	@com.lianjing.sh.model.common.annotation.Comment("分配者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分配者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_BranchCompanyStaff assignor;

	@com.lianjing.sh.model.common.annotation.Comment("配送者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("配送者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_BranchCompanyStaff sender;

	@com.lianjing.sh.model.common.annotation.Comment("产品订单项")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单项")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="productOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems;

	@com.lianjing.sh.model.common.annotation.Comment("用户")
	@com.lianjing.sh.processing.info.annotation.InfoComment("用户")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_User user;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=true)
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	@com.lianjing.sh.model.common.annotation.Comment("分公司金额记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司金额记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="productOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords;

	/** get[状态] */
	public bairui.international.model.status.State_ProductOrder getState() {
		return this.state;
	}

	/** get[付款方式] */
	public bairui.international.model.type.Type_ProductOrderPay getPayWay() {
		return this.payWay;
	}

	/** get[编号] */
	public String getNumber() {
		return this.number;
	}

	/** get[提交时间] */
	public java.util.Date getSubmitDate() {
		return this.submitDate;
	}

	/** get[价格] */
	public Double getPrice() {
		return this.price;
	}

	/** get[抵扣的积分] */
	public Double getUsedScore() {
		return this.usedScore;
	}

	/** get[实际付款] */
	public Double getPay() {
		return this.pay;
	}

	/** get[区域记录] */
	public String getAreaRecord() {
		return this.areaRecord;
	}

	/** get[产品订单状态记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderStateRecord> getProductOrderStateRecords() {
		return this.productOrderStateRecords;
	}

	/** get[用户信息] */
	public bairui.international.model.domain.jpa.TB_UserInfo getUserInfo() {
		return this.userInfo;
	}

	/** get[图片] */
	public String getImgUrl() {
		return this.imgUrl;
	}

	/** get[收货信息] */
	public bairui.international.model.domain.jpa.TB_GoodsInfo getGoodsInfo() {
		return this.goodsInfo;
	}

	/** get[汇款截图] */
	public String getRemitImgUrl() {
		return this.remitImgUrl;
	}

	/** get[分公司员工提成记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord> getBranchCompanyStaffRoyaltyRecords() {
		return this.branchCompanyStaffRoyaltyRecords;
	}

	/** get[用户积分记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_UserGradeRecord> getUserGradeRecords() {
		return this.userGradeRecords;
	}

	/** get[积分] */
	public Double getScore() {
		return this.score;
	}

	/** get[类型] */
	public bairui.international.model.type.Type_ProductOrder getType() {
		return this.type;
	}

	/** get[电子券] */
	public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket() {
		return this.electronicTicket;
	}

	/** get[备注] */
	public String getComment() {
		return this.comment;
	}

	/** get[分公司] */
	public bairui.international.model.domain.jpa.TB_BranchCompany getBranchCompany() {
		return this.branchCompany;
	}

	/** get[区域] */
	public bairui.international.model.domain.jpa.TB_Town getArea() {
		return this.area;
	}

	/** get[中心指派标志] */
	public Boolean getAssignFlag() {
		return this.assignFlag;
	}

	/** get[分配者] */
	public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getAssignor() {
		return this.assignor;
	}

	/** get[配送者] */
	public bairui.international.model.domain.jpa.TB_BranchCompanyStaff getSender() {
		return this.sender;
	}

	/** get[产品订单项] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> getProductOrderItems() {
		return this.productOrderItems;
	}

	/** get[用户] */
	public bairui.international.model.domain.jpa.TB_User getUser() {
		return this.user;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** get[分公司金额记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> getBranchCompanyMoneyRecords() {
		return this.branchCompanyMoneyRecords;
	}

	/** set[状态] */
	public void setState(bairui.international.model.status.State_ProductOrder state) {
		this.state = state;
	}

	/** set[付款方式] */
	public void setPayWay(bairui.international.model.type.Type_ProductOrderPay payWay) {
		this.payWay = payWay;
	}

	/** set[编号] */
	public void setNumber(String number) {
		this.number = number;
	}

	/** set[提交时间] */
	public void setSubmitDate(java.util.Date submitDate) {
		this.submitDate = submitDate;
	}

	/** set[价格] */
	public void setPrice(Double price) {
		this.price = price;
	}

	/** set[抵扣的积分] */
	public void setUsedScore(Double usedScore) {
		this.usedScore = usedScore;
	}

	/** set[实际付款] */
	public void setPay(Double pay) {
		this.pay = pay;
	}

	/** set[区域记录] */
	public void setAreaRecord(String areaRecord) {
		this.areaRecord = areaRecord;
	}

	/** set[产品订单状态记录] */
	public void setProductOrderStateRecords(java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderStateRecord> productOrderStateRecords) {
		this.productOrderStateRecords = productOrderStateRecords;
	}

	/** set[用户信息] */
	public void setUserInfo(bairui.international.model.domain.jpa.TB_UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	/** set[图片] */
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	/** set[收货信息] */
	public void setGoodsInfo(bairui.international.model.domain.jpa.TB_GoodsInfo goodsInfo) {
		this.goodsInfo = goodsInfo;
	}

	/** set[汇款截图] */
	public void setRemitImgUrl(String remitImgUrl) {
		this.remitImgUrl = remitImgUrl;
	}

	/** set[分公司员工提成记录] */
	public void setBranchCompanyStaffRoyaltyRecords(java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord> branchCompanyStaffRoyaltyRecords) {
		this.branchCompanyStaffRoyaltyRecords = branchCompanyStaffRoyaltyRecords;
	}

	/** set[用户积分记录] */
	public void setUserGradeRecords(java.util.List<bairui.international.model.domain.jpa.TB_UserGradeRecord> userGradeRecords) {
		this.userGradeRecords = userGradeRecords;
	}

	/** set[积分] */
	public void setScore(Double score) {
		this.score = score;
	}

	/** set[类型] */
	public void setType(bairui.international.model.type.Type_ProductOrder type) {
		this.type = type;
	}

	/** set[电子券] */
	public void setElectronicTicket(bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket) {
		this.electronicTicket = electronicTicket;
	}

	/** set[备注] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** set[分公司] */
	public void setBranchCompany(bairui.international.model.domain.jpa.TB_BranchCompany branchCompany) {
		this.branchCompany = branchCompany;
	}

	/** set[区域] */
	public void setArea(bairui.international.model.domain.jpa.TB_Town area) {
		this.area = area;
	}

	/** set[中心指派标志] */
	public void setAssignFlag(Boolean assignFlag) {
		this.assignFlag = assignFlag;
	}

	/** set[分配者] */
	public void setAssignor(bairui.international.model.domain.jpa.TB_BranchCompanyStaff assignor) {
		this.assignor = assignor;
	}

	/** set[配送者] */
	public void setSender(bairui.international.model.domain.jpa.TB_BranchCompanyStaff sender) {
		this.sender = sender;
	}

	/** set[产品订单项] */
	public void setProductOrderItems(java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems) {
		this.productOrderItems = productOrderItems;
	}

	/** set[用户] */
	public void setUser(bairui.international.model.domain.jpa.TB_User user) {
		this.user = user;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}

	/** set[分公司金额记录] */
	public void setBranchCompanyMoneyRecords(java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords) {
		this.branchCompanyMoneyRecords = branchCompanyMoneyRecords;
	}


	public void assignUserInfo(bairui.international.model.domain.jpa.TB_UserInfo userInfo) {
		if(null != userInfo){
			userInfo.setProductOrder(this);
		}
		this.setUserInfo(userInfo);
	}
	

	public void assignGoodsInfo(bairui.international.model.domain.jpa.TB_GoodsInfo goodsInfo) {
		if(null != goodsInfo){
			goodsInfo.setProductOrder(this);
		}
		this.setGoodsInfo(goodsInfo);
	}
	



	public void assignElectronicTicket(bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket) {
		if(null != electronicTicket){
			electronicTicket.setProductOrder(this);
		}
		this.setElectronicTicket(electronicTicket);
	}
	

	public void assignBranchCompany(bairui.international.model.domain.jpa.TB_BranchCompany branchCompany) {
		if(null != branchCompany){
			branchCompany.addProductOrders(this);
		}
		this.setBranchCompany(branchCompany);
	}
	

	public void assignArea(bairui.international.model.domain.jpa.TB_Town area) {
		if(null != area){
			area.addProductOrders(this);
		}
		this.setArea(area);
	}
	

	public void assignAssignor(bairui.international.model.domain.jpa.TB_BranchCompanyStaff assignor) {
		if(null != assignor){
			assignor.addAssignOrders(this);
		}
		this.setAssignor(assignor);
	}
	

	public void assignSender(bairui.international.model.domain.jpa.TB_BranchCompanyStaff sender) {
		if(null != sender){
			sender.addSendOrders(this);
		}
		this.setSender(sender);
	}
	


	public void assignUser(bairui.international.model.domain.jpa.TB_User user) {
		if(null != user){
			user.addProductOrders(this);
		}
		this.setUser(user);
	}
	



	/** add[ProductOrderStateRecords] */
	public TB_ProductOrder addProductOrderStateRecords(bairui.international.model.domain.jpa.TB_ProductOrderStateRecord ... productOrderStateRecords){
		if(this.productOrderStateRecords == null){
			this.productOrderStateRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderStateRecord bean : productOrderStateRecords){
			bean.setProductOrder(this);
			this.productOrderStateRecords.add(bean);
		}
		return this;
	}
	/** add[BranchCompanyStaffRoyaltyRecords] */
	public TB_ProductOrder addBranchCompanyStaffRoyaltyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord ... branchCompanyStaffRoyaltyRecords){
		if(this.branchCompanyStaffRoyaltyRecords == null){
			this.branchCompanyStaffRoyaltyRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord bean : branchCompanyStaffRoyaltyRecords){
			bean.setProductOrder(this);
			this.branchCompanyStaffRoyaltyRecords.add(bean);
		}
		return this;
	}
	/** add[UserGradeRecords] */
	public TB_ProductOrder addUserGradeRecords(bairui.international.model.domain.jpa.TB_UserGradeRecord ... userGradeRecords){
		if(this.userGradeRecords == null){
			this.userGradeRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_UserGradeRecord bean : userGradeRecords){
			bean.setProductOrder(this);
			this.userGradeRecords.add(bean);
		}
		return this;
	}
	/** add[ProductOrderItems] */
	public TB_ProductOrder addProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null){
			this.productOrderItems = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderItem bean : productOrderItems){
			bean.setProductOrder(this);
			this.productOrderItems.add(bean);
		}
		return this;
	}
	/** add[BranchCompanyMoneyRecords] */
	public TB_ProductOrder addBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null){
			this.branchCompanyMoneyRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord bean : branchCompanyMoneyRecords){
			bean.setProductOrder(this);
			this.branchCompanyMoneyRecords.add(bean);
		}
		return this;
	}
	
	/** remove[ProductOrderStateRecords] */
	public TB_ProductOrder removeProductOrderStateRecords(bairui.international.model.domain.jpa.TB_ProductOrderStateRecord ... productOrderStateRecords){
		if(this.productOrderStateRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderStateRecord bean : productOrderStateRecords){
			bean.setProductOrder(null);
			this.productOrderStateRecords.remove(bean);
		}
		return this;
	}
	/** remove[BranchCompanyStaffRoyaltyRecords] */
	public TB_ProductOrder removeBranchCompanyStaffRoyaltyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord ... branchCompanyStaffRoyaltyRecords){
		if(this.branchCompanyStaffRoyaltyRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord bean : branchCompanyStaffRoyaltyRecords){
			bean.setProductOrder(null);
			this.branchCompanyStaffRoyaltyRecords.remove(bean);
		}
		return this;
	}
	/** remove[UserGradeRecords] */
	public TB_ProductOrder removeUserGradeRecords(bairui.international.model.domain.jpa.TB_UserGradeRecord ... userGradeRecords){
		if(this.userGradeRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_UserGradeRecord bean : userGradeRecords){
			bean.setProductOrder(null);
			this.userGradeRecords.remove(bean);
		}
		return this;
	}
	/** remove[ProductOrderItems] */
	public TB_ProductOrder removeProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderItem bean : productOrderItems){
			bean.setProductOrder(null);
			this.productOrderItems.remove(bean);
		}
		return this;
	}
	/** remove[BranchCompanyMoneyRecords] */
	public TB_ProductOrder removeBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord bean : branchCompanyMoneyRecords){
			bean.setProductOrder(null);
			this.branchCompanyMoneyRecords.remove(bean);
		}
		return this;
	}
	
	/**
	 * contains[ProductOrderStateRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductOrderStateRecords(bairui.international.model.domain.jpa.TB_ProductOrderStateRecord ... productOrderStateRecords){
		if(this.productOrderStateRecords == null || productOrderStateRecords==null || productOrderStateRecords.length<=0){
			return false;
		}
		return this.productOrderStateRecords.containsAll(java.util.Arrays.asList(productOrderStateRecords));
	}
	/**
	 * contains[BranchCompanyStaffRoyaltyRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsBranchCompanyStaffRoyaltyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyStaffRoyaltyRecord ... branchCompanyStaffRoyaltyRecords){
		if(this.branchCompanyStaffRoyaltyRecords == null || branchCompanyStaffRoyaltyRecords==null || branchCompanyStaffRoyaltyRecords.length<=0){
			return false;
		}
		return this.branchCompanyStaffRoyaltyRecords.containsAll(java.util.Arrays.asList(branchCompanyStaffRoyaltyRecords));
	}
	/**
	 * contains[UserGradeRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsUserGradeRecords(bairui.international.model.domain.jpa.TB_UserGradeRecord ... userGradeRecords){
		if(this.userGradeRecords == null || userGradeRecords==null || userGradeRecords.length<=0){
			return false;
		}
		return this.userGradeRecords.containsAll(java.util.Arrays.asList(userGradeRecords));
	}
	/**
	 * contains[ProductOrderItems]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null || productOrderItems==null || productOrderItems.length<=0){
			return false;
		}
		return this.productOrderItems.containsAll(java.util.Arrays.asList(productOrderItems));
	}
	/**
	 * contains[BranchCompanyMoneyRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null || branchCompanyMoneyRecords==null || branchCompanyMoneyRecords.length<=0){
			return false;
		}
		return this.branchCompanyMoneyRecords.containsAll(java.util.Arrays.asList(branchCompanyMoneyRecords));
	}
	

	/** take[用户信息] */
	public bairui.international.model.domain.jpa.TB_UserInfo takeUserInfo(){
		if(null == this.userInfo){
			this.userInfo = new bairui.international.model.domain.jpa.TB_UserInfo();
		}
		return this.userInfo;
	}
	
	/** take[收货信息] */
	public bairui.international.model.domain.jpa.TB_GoodsInfo takeGoodsInfo(){
		if(null == this.goodsInfo){
			this.goodsInfo = new bairui.international.model.domain.jpa.TB_GoodsInfo();
		}
		return this.goodsInfo;
	}
	
	/** take[电子券] */
	public bairui.international.model.domain.jpa.TB_ElectronicTicket takeElectronicTicket(){
		if(null == this.electronicTicket){
			this.electronicTicket = new bairui.international.model.domain.jpa.TB_ElectronicTicket();
		}
		return this.electronicTicket;
	}
	
	/** take[分公司] */
	public bairui.international.model.domain.jpa.TB_BranchCompany takeBranchCompany(){
		if(null == this.branchCompany){
			this.branchCompany = new bairui.international.model.domain.jpa.TB_BranchCompany();
		}
		return this.branchCompany;
	}
	
	/** take[区域] */
	public bairui.international.model.domain.jpa.TB_Town takeArea(){
		if(null == this.area){
			this.area = new bairui.international.model.domain.jpa.TB_Town();
		}
		return this.area;
	}
	
	/** take[分配者] */
	public bairui.international.model.domain.jpa.TB_BranchCompanyStaff takeAssignor(){
		if(null == this.assignor){
			this.assignor = new bairui.international.model.domain.jpa.TB_BranchCompanyStaff();
		}
		return this.assignor;
	}
	
	/** take[配送者] */
	public bairui.international.model.domain.jpa.TB_BranchCompanyStaff takeSender(){
		if(null == this.sender){
			this.sender = new bairui.international.model.domain.jpa.TB_BranchCompanyStaff();
		}
		return this.sender;
	}
	
	/** take[用户] */
	public bairui.international.model.domain.jpa.TB_User takeUser(){
		if(null == this.user){
			this.user = new bairui.international.model.domain.jpa.TB_User();
		}
		return this.user;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	/** must[用户] */
	public bairui.international.model.domain.jpa.TB_User mustUser() {
		return this.user;
	}
	
	/** optional[用户信息] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_UserInfo> optionalUserInfo() {
		return java.util.Optional.ofNullable(this.userInfo);
	}
	
	/** optional[收货信息] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_GoodsInfo> optionalGoodsInfo() {
		return java.util.Optional.ofNullable(this.goodsInfo);
	}
	
	/** optional[电子券] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_ElectronicTicket> optionalElectronicTicket() {
		return java.util.Optional.ofNullable(this.electronicTicket);
	}
	
	/** optional[分公司] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_BranchCompany> optionalBranchCompany() {
		return java.util.Optional.ofNullable(this.branchCompany);
	}
	
	/** optional[区域] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Town> optionalArea() {
		return java.util.Optional.ofNullable(this.area);
	}
	
	/** optional[分配者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> optionalAssignor() {
		return java.util.Optional.ofNullable(this.assignor);
	}
	
	/** optional[配送者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> optionalSender() {
		return java.util.Optional.ofNullable(this.sender);
	}
	
	/** optional[最后修改者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalLastModifier() {
		return java.util.Optional.ofNullable(this.lastModifier);
	}
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_ProductOrder other = (TB_ProductOrder) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public bairui.international.model.status.State_ProductOrder state(){
		return this.getState();
	}


}
